package com.base.service.workflow.bo;

import java.io.Serializable;
import java.util.List;

import com.base.service.workflow.bo.AssigneeConfigBO.AssigneeBO;
import com.gitee.magic.core.valid.annotation.Format;
import com.gitee.magic.core.valid.annotation.Format.FormatType;
import com.gitee.magic.core.valid.annotation.Length;
import com.gitee.magic.core.valid.annotation.NotNull;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter@Setter@ToString
public class DeploymentBO implements Serializable{
	
	private static final long serialVersionUID = 1L;

	@Schema(description="唯一KEY")
	@NotNull
	@Length(max=32)
	private String key;

	@Schema(description="开始节点")
	@NotNull
	@Length(max=32)
	private String startEvent;

	@Schema(description="结束节点")
	@NotNull
	@Length(max=32)
	private String endEvent;

	@Schema(description="网关节点")
	@NotNull
	@Format(type = FormatType.JSONArray)
	private List<String> exclusiveGateway;

	@Schema(description="节点定义")
	@NotNull
	@Format(type = FormatType.JSONArray)
	private List<UserTaskBO> userTask;

	@Schema(description="流转定义")
	@NotNull
	@Format(type = FormatType.JSONArray)
	private List<SequenceFlowBO> sequenceFlow;

	@Schema(description="抄送列表")
	@NotNull
	@Format(type = FormatType.JSONArray)
	private List<AssigneeBO> cc;

	@Getter@Setter@ToString
	public static class UserTaskBO implements Serializable {
		
		private static final long serialVersionUID = 1L;

		@Schema(description="名称")
		@NotNull
		@Length(max=32)
		private String name;

		@Schema(description="标签")
		@NotNull
		@Length(max=32)
		private String label;

		@Schema(description="配置数据")
		@NotNull
		@Format(type=FormatType.JSON_OBJECT)
		private AssigneeConfigBO data;
		
	}

	@Getter@Setter@ToString
	public static class SequenceFlowBO implements Serializable {
		
		private static final long serialVersionUID = 1L;

		@Schema(description="标签")
		@NotNull
		@Length(max=32)
		private String label;

		@Schema(description="源节点名称引用")
		@NotNull
		@Length(max=32)
		private String sourceRef;

		@Schema(description="目标节点名称引用")
		@NotNull
		@Length(max=32)
		private String targetRef;

		@Schema(description="表达式")
		@Length(max=64)
		private String expression;
		
	}
	
}
